# -*- coding: utf-8 -*-
from django.conf.urls import url,include
import views
from project.models import project
from rest_framework import routers, serializers, viewsets

class ProjectSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = project
        fields = ('url', 'name', 'ip')
        
class ProjectViewSet(viewsets.ModelViewSet):
    queryset = project.objects.all()
    serializer_class = ProjectSerializer
    
router = routers.DefaultRouter()
router.register(r'project', ProjectViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]